<?php
	//include("../connect/connect_dsccmis.php");
	//
	$sql = "drop table if exists mis_numvictim_losbody;";
	$rs=mysql_query($sql);
	
    $sql="create table mis_numvictim_losbody as 
select t1.perid,t1.sex,mis_reg,mis_occid,mis_losbody,SummLosbody_new,t1.evndte,left(t1.evnplcidgen,2) as prov,left(t1.evnplcidgen,4) as amp,t2.cdscc 
from mis_viewlosofper t1 
inner join dscc.TempEventAndCaseOfEvent t2 on t1.evnid=t2.evnid
inner join convert_losbody t3 on t1.losbody=t3.losbody 
inner join convert_occ t4 on t1.occid=t4.occid 
inner join convert_reg t5 on t1.reg=t5.reg
inner join dscc.tempeventperlosandcaseofevent t6 on t1.perid=t6.perid and t1.evnid=t6.evnid
where left(t1.evnplcidgen,2) in ('94','95','96') or left(t1.evnplcidgen,4) in ('9003','9004','9005','9006')";
	$rs=mysql_query($sql);


	//mysql_close($c);
	if($rs){
	echo "<br>complete create mis_numvictim_losbody on dsccmis";
	}else{
		echo"$sql";
		echo"Can not process.";
	}
?>